/**
 *
 */
Ext.define('vacake.view.UsersCurrent', {
    extend: 'Ext.List',
    xtype: 'usersCurrent',
    config: {
        items: [
            {
                docked: 'top',
                xtype: 'toolbar',
                title: '未完成订单',
                items: [
                    {
                        text: '返回',
                        ui: 'action-back',
                        handler: function () {
                            Ext.Viewport.remove(this.up('usersCurrent'), true);
                        }
                    },{
                        xtype: "spacer"
                    },{
                        text: '刷新',
                        id: 'refreshButton',
                        handler: function () {
                            var usersCurrent = Ext.getStore('UsersCurrent');
                            usersCurrent.load({params: {cuid: window.localStorage.getItem('app_Login_id'), cadid: window.localStorage.getItem('app_district_id')}});
                        }
                    }
                ]
            }
        ],
        store: 'UsersCurrent',
        selectedCls:false,
        pressedCls:false,
        emptyText: '<div style="width: 100%; height: 100%; text-align: center; vertical-align: middle">' +
            '<img width="94" height="94" src="resources/images/null.png" style="margin-top:100px;"   /> ' +
            '<div class="height30 color2 font2">暂时没有订单</div>' +
            '</div>',
        itemTpl:

                '<div class="height30 font3 color2 hidden">' +
                    '<div style="width: 60%; float: left">订单编号：{ordersNo}</div>' +
                    '<div style="width:40%;float: left">总价：' +
                        '<span class="color7">{totalmoney}￥</span>' +
                    '</div>' +
                '</div>' +

                '<div class="height30 font3 color2 hidden">' +
                    '<div style="width:60%; float: left">提货方式：{picktype}</div>' +
                    '<div style="width:40%;float: left">付款方式：{paymenttype}</div>' +
                '</div> ' +

                '<div class="height30 font3 color2 hidden">' +
                    '<div style="width: 60%; float: left">状态：<span class="color7">{status}<span> </div>' +
                    '<tpl if="paymenttype ==\'在线支付\'">' +
                        '<div style="width:40%;float: left">付款状态：{paymentstatus}</div>' +
                    '</tpl>' +
                '</div>' +

                '<tpl for="products">' +
                    '<div class="more_border"></div>' +
                    '<div style="min-height: 80px; margin: 5px 0px;">' +
                        '<img  src="{picurl}" style="float: left;height: 80px;width: 80px" class="radius"/> ' +
                        '<div class="homelist_name height30 color2 font3">{pname}</div>' +
                        '<div class="homelist_name height30 color2 font3">' +
                            '<span>{sname} <span>' +
                            '<span class="color5" style="margin-left: 10px;">{price}</span>' +
                        '</div>' +
                    '</div>' +
                '</tpl>' +
                    '<div class="more_border"></div>' +
                    '<div style="text-align: center;margin-top: 4px;"><tpl if="paymenttype ==\'货到付款\' || paymentstatus==\'已支付\'"><input type="button" value="确认收货"  name="goodsButton"  data-coid="{coid}" style="width:140px;" class="x-button4 shadow radius2 height40 color6 font2 blod" /></tpl>' +
                    '<tpl if="paymenttype ==\'在线支付\'&&paymentstatus==\'未支付\'"><input type="button" value="未支付,请付款"  name="payButton"  data-ordersno="{ordersNo}" style="width:140px;" class="x-button6 shadow radius2 height40 color6 font2 blod" /></tpl>' +
                    '</div>'+
                    '</div><div style="clear: both;">',
        listeners: {
            initialize: function () {//当页面初始化前,执行
             
            },
            painted: function () {
                var usersCurrent = Ext.getStore('UsersCurrent');
                usersCurrent.load({params: {cuid: window.localStorage.getItem('app_Login_id'), cadid: window.localStorage.getItem('app_district_id')}});
                Ext.Viewport.unmask();
            },back: function () {
                var backid = Ext.Viewport.getInnerItems().length - 2;
                Ext.Viewport.remove(Ext.Viewport.getActiveItem(), true);
                Ext.Viewport.setActiveItem(backid);
            }
        }
    }

});

